import json from 'rollup-plugin-json';   //支持引用json文件
import resolve from "rollup-plugin-node-resolve";  //解析外部依赖包
import commonjs from "rollup-plugin-commonjs";  //将CommonJS模块转换为 ES2015 供 Rollup 处理
import { terser } from "rollup-plugin-terser";  //用于压缩代码
import babel from 'rollup-plugin-babel'
module.exports = {
    input:'src/index.js',
    output:{
        file:'dist/sdk.bundle.js',
        format:'umd',
        sourcemap:true,
        name:'YJSDK'
    },
    plugins:[commonjs(),resolve(),json(),babel({   //babel设置支持es6转为es5
       exclude: [/\/core-js\//],
       runtimeHelpers:true  ,
       sourcemap:true,
       extensions: [".js", ".jsx", ".es6", ".es", ".mjs", ".ts"]
    })]
}